/*
Copyright (C) 2008, 2009 Henrik Naess

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Globalization;
using ZoneFiveSoftware.Common.Data.GPS;

namespace MatrixPlugin
{
    public class ExtendedGPSPoint
    {
        // Fixed data for position
        protected GPSPoint m_gpsPoint;
        protected string m_name;

        #region Properties, Get/Set

        /// <summary>GPSPoint for the position of the Point</summary>
        public GPSPoint GpsPoint
        {
            get { return m_gpsPoint; }
            set { m_gpsPoint = value; }
        }

        /// <summary>Name of the point</summary>
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }

        public string LatitudeInUSDecimalFormat
        {
            get
            {
                string latitude = Convert.ToString(m_gpsPoint.LatitudeDegrees, new CultureInfo("en-US"));
                return latitude;
            }
        }

        public string LongitudeInUSDecimalFormat
        {
            get
            {
                string longitude = Convert.ToString(m_gpsPoint.LongitudeDegrees, new CultureInfo("en-US"));
                return longitude;
            }
        }

        #endregion

        public ExtendedGPSPoint()
        {
            throw new NotImplementedException("Not supported");
        }

        /// <summary>
        /// Constructor for creating a Point
        /// </summary>
        /// <param name="name">name of the point</param>
        /// <param name="gpsPoint">point</param>
        public ExtendedGPSPoint(string name, GPSPoint gpsPoint)
        {
            m_name = name;
            m_gpsPoint = gpsPoint;
        }

        /// <summary>
        /// Constructor for creating a Point
        /// </summary>
        /// <param name="name">name of the point</param>
        /// <param name="latitude">latitude for gps point</param>
        /// <param name="longitude">longitude for gps point</param>
        public ExtendedGPSPoint(string name, float latitude, float longitude)
        {
            m_name = name;
            m_gpsPoint = new GPSPoint(latitude, longitude, float.NaN); // float.NaN = unknown elevation
        }
    }
}